home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / devices / prtbase.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  7KB  |  185 lines

  1. #ifndef  DEVICES_PRTBASE_H
  2. #define  DEVICES_PRTBASE_H 1
  3. /*
  4. ** prtbase.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/03/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for prtbase.h
  17. */
  18. #ifndef DeviceDataPtr
  19. #define DeviceDataPtr ADDRESS
  20. #endif
  21. #ifndef PrinterDataPtr
  22. #define PrinterDataPtr ADDRESS
  23. #endif
  24. #ifndef PrinterExtendedDataPtr
  25. #define PrinterExtendedDataPtr ADDRESS
  26. #endif
  27. #ifndef PrinterSegmentPtr
  28. #define PrinterSegmentPtr ADDRESS
  29. #endif
  30. /*
  31. ** End of StructPointer defines for prtbase.h
  32. */
  33.        
  34. #ifndef  EXEC_TYPES_H
  35. #include <exec/types.h>
  36. #endif
  37. #ifndef  EXEC_NODES_H
  38. #include <exec/nodes.h>
  39. #endif
  40. #ifndef  EXEC_LISTS_H
  41. #include <exec/lists.h>
  42. #endif
  43. #ifndef  EXEC_PORTS_H
  44. #include <exec/ports.h>
  45. #endif
  46. #ifndef  EXEC_LIBRARIES_H
  47. #include <exec/libraries.h>
  48. #endif
  49. #ifndef  EXEC_TASKS_H
  50. #include <exec/tasks.h>
  51. #endif
  52.  
  53. #ifndef  DEVICES_PARALLEL_H
  54. #include <devices/parallel.h>
  55. #endif
  56. #ifndef  DEVICES_SERIAL_H
  57. #include <devices/SERIAL.h>
  58. #endif
  59. #ifndef  DEVICES_TIMER_H
  60. #include <devices/timer.h>
  61. #endif
  62. #ifndef  LIBRARIES_DOSEXTENS_H
  63. #include <libraries/dosextens.h>
  64. #endif
  65. #ifndef  INTUITION_INTUITION_H
  66. #include <intuition/intuition.h>
  67. #endif
  68.  
  69.  
  70.  
  71. STRUCT DeviceData  
  72.     _Library dd_Device  /* standard library node */
  73.     ADDRESS dd_Segment           /* A0 when initialized */
  74.     ADDRESS dd_ExecBase          /* A6 for exec */
  75.     ADDRESS dd_CmdVectors        /* command table for device commands */
  76.     ADDRESS dd_CmdBytes          /* bytes describing which command queue */
  77.     SHORTINT   dd_NumCommands    /* the number of commands supported */
  78. END STRUCT 
  79.  
  80. #define P_OLDSTKSIZE    &H0800  /* stack size for child task (OBSOLETE) */
  81. #define P_STKSIZE   &H1000  /* stack size for child task */
  82. #define P_BUFSIZE   256 /* size of internal buffers for text i/o */
  83. #define P_SAFESIZE  128 /* safety margin for text output buffer */
  84.  
  85. STRUCT   PrinterData  
  86.     DeviceData pd_Device 
  87.     MsgPort pd_Unit  /* the one and only unit */
  88.     ADDRESS pd_PrinterSegment  /* the printer specific segment */
  89.     SHORTINT pd_PrinterType    /* the segment printer type */
  90.                 /* the segment data structure */
  91.     PrinterSegmentPtr  pd_SegmentData 
  92.     ADDRESS   pd_PrintBuf  /* the raster print buffer */
  93.     ADDRESS   pd_PWrite  /* the write function */
  94.     ADDRESS   pd_PBothReady  /* write function's done */
  95.                             /* port I/O request 0 */
  96.     IOExtPar pd_ior0 
  97. #define  pd_PIOR0 pd_ior0.pd_p0
  98. #define  pd_SIOR0 pd_ior0.pd_s0
  99.  
  100.                             /*   and 1 for double buffering */
  101.     IOExtPar pd_ior1 
  102.  
  103. #define  pd_PIOR1 pd_ior1.pd_p1
  104. #define  pd_SIOR1 pd_ior1.pd_s1
  105.  
  106.     timerequest pd_TIOR  /* timer I/O request */
  107.     MsgPort pd_IORPort   /* and message reply port */
  108.     Task pd_TC       /* write task */
  109.     STRING pd_OldStk SIZE &H0800 /* P_OLDSTKSIZE */   /* AND stack space (OBSOLETE) */
  110.     BYTE  pd_Flags          /* device flags */
  111.     BYTE  pd_pad            /* padding */
  112.     Preferences pd_Preferences   /* the latest preferences */
  113.     BYTE  pd_PWaitEnabled       /* wait function switch */
  114.     /* new fields for V2.0 */
  115.     BYTE  pd_Flags1         /* padding */
  116.     STRING pd_Stk SIZE &H1000   /* P_STKSIZE */     /* stack space */
  117. END STRUCT 
  118.  
  119. /* Printer Class */
  120. #define PPCB_GFX    0   /* graphics (bit position) */
  121. #define PPCF_GFX    &H1 /* graphics (and/or flag) */
  122. #define PPCB_COLOR  1   /* color (bit position) */
  123. #define PPCF_COLOR  &H2 /* color (and/or flag) */
  124.  
  125. #define PPC_BWALPHA &H00    /* black&white alphanumerics */
  126. #define PPC_BWGFX   &H01    /* black&white graphics */
  127. #define PPC_COLORALPHA  &H02    /* color alphanumerics */
  128. #define PPC_COLORGFX    &H03    /* color graphics */
  129.  
  130. /* Color Class */
  131. #define PCC_BW      &H01    /* black&white only */
  132. #define PCC_YMC     &H02    /* yellow/magenta/cyan only */
  133. #define PCC_YMC_BW  &H03    /* yellow/magenta/cyan or black&white */
  134. #define PCC_YMCB    &H04    /* yellow/magenta/cyan/black */
  135. #define PCC_4COLOR  &H04    /* a flag for YMCB and BGRW */
  136. #define PCC_ADDITIVE    &H08    /* not ymcb but blue/green/red/white */
  137. #define PCC_WB      &H09    /* black&white only,  0 == BLACK */
  138. #define PCC_BGR     &H0A    /* blue/green/red */
  139. #define PCC_BGR_WB  &H0B    /* blue/green/red or black&white */
  140. #define PCC_BGRW    &H0C    /* blue/green/red/white */
  141. /*
  142.     The picture must be scanned once for each color component,  as the
  143.     printer can only define one color at a time.  ie. If 'PCC_YMC' then
  144.     first pass sends all 'Y' info to printer,  second pass sends all 'M'
  145.     info,  _and third pass sends all C info to printer.  The CalComp
  146.     PlotMaster is an example of this type of printer.
  147. */
  148. #define PCC_MULTI_PASS  &H10    /* see explanation above */
  149.  
  150. STRUCT PrinterExtendedData  
  151.     ADDRESS   ped_PrinterName     /* printer name,  null terminated */
  152.     ADDRESS   ped_Init        /* called after LoadSeg */
  153.     ADDRESS   ped_Expunge     /* called before UnLoadSeg */
  154.     ADDRESS   ped_Open        /* called at OpenDevice */
  155.     ADDRESS   ped_Close       /* called at CloseDevice */
  156.     BYTE    ped_PrinterClass     /* printer class */
  157.     BYTE    ped_ColorClass       /* color class */
  158.     BYTE    ped_MaxColumns       /* number of print columns available */
  159.     BYTE    ped_NumCharSets      /* number of character sets */
  160.     SHORTINT   ped_NumRows          /* number of 'pins' in print head */
  161.     LONGINT   ped_MaxXDots         /* number of dots max in a raster dump */
  162.     LONGINT   ped_MaxYDots         /* number of dots max in a raster dump */
  163.     SHORTINT   ped_XDotsInch        /* horizontal dot density */
  164.     SHORTINT   ped_YDotsInch        /* vertical dot density */
  165.     ADDRESS   ped_Commands      /* printer text command table */
  166.     ADDRESS   ped_DoSpecial   /* special command handler */
  167.     ADDRESS   ped_Render      /* raster render function */
  168.     LONGINT    ped_TimeoutSecs      /* good write timeout */
  169.     /* the following only exists if the segment version is >= 33 */
  170.     ADDRESS   ped_8BitChars      /* conv. strings for the extended font */
  171.     LONGINT    ped_PrintMode        /* set if text printed,  otherwise 0 */
  172.     /* the following only exists if the segment version is >= 34 */
  173.     /* ptr to conversion function for all chars */
  174.     ADDRESS   ped_ConvFunc
  175. END STRUCT 
  176.  
  177. STRUCT PrinterSegment  
  178.     LONGINT   ps_NextSegment   /* (actually a ADDRESS) */
  179.     LONGINT   ps_runAlert      /* MOVEQ #0, D0 : RTS */
  180.     SHORTINT   ps_Version   /* segment version */
  181.     SHORTINT   ps_Revision      /* segment revision */
  182.     PrinterExtendedData ps_PED    /* printer extended data */
  183. END STRUCT 
  184. #endif
  185.